﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using Consultant.Models;

namespace Consultant.Controllers
{
    public class AdminController : Controller
    {
        private DataManager _dataManager;

        public AdminController(DataManager dataManager)
        {
            _dataManager = dataManager;
        }

        public ActionResult Query()
        {
            ViewData.Model = _dataManager.Admin.GetUnActivQuery(User.Identity.Name);

            return View();
        }

        [AcceptVerbs(HttpVerbs.Get)]
        public ActionResult AddQuery(int id)
        {
            _dataManager.Admin.AddQuery(id);
            return RedirectToAction("Index", "Home");
        }

        [AcceptVerbs(HttpVerbs.Get)]
        public ActionResult DeleteQuery(int id)
        {
            _dataManager.Admin.DeleteQuery(id);
            return RedirectToAction("Index", "Home");
        }

    }
}
